<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>vue</title>
</head>
<script src="vue.js"></script>
<body>
    <div id="app">
        <span v-star="green">后端君</span>
       <!-- <input type="text" v-model="title" v-hd.focus="title">-->
    </div>
<script>

//    Vue.directive('start',{
//        bind(el,bind){
//            console.log(bind);
//        }
//    });
    Vue.directive('hd',function(el,bind){
            console.log(bind);
    });

    var app=new Vue({
        el:'#app',
        data:{
            type:true,
            title:'后端君',
        },
        directives:{
            star(el,bind){
                    cplor=bind.value?bind.value:'red';
                    console.log(bind);
                    el.style.cssText='color:red';

            }
        }
    });

</script>

</body>
</html>